package tianrun.ziguan.api.calculate.config.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import tianrun.ziguan.api.calculate.config.entity.base.BaseTemplateInstance;
import tianrun.ziguan.api.calculate.config.enums.DrivingTypeEnum;

import java.io.Serializable;
import java.util.Date;

/**
 * 自定义指标组件实例表
 *
 * @author zhaoqi
 */
public class TIndicatorsInstance extends BaseTemplateInstance implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键Id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 计算点
     */
    @TableField("cal_label")
    private String calLabel;

    /**
     * 名称
     */
    @TableField("name")
    private String name;

    /**
     * 描述
     */
    @TableField("description")
    private String description;

    /**
     * 组件id
     */
    @TableField("module_id")
    private Long moduleId;

    /**
     * 小数位
     */
    @TableField("decimal_places")
    private Integer decimalPlaces;

    /**
     * 数据开关；0不计算，1计算
     */
    @TableField("data_switch")
    private Boolean dataSwitch;

    /**
     * 驱动方式，自定义指标使用；data数据驱动，time时间驱动
     */
    @TableField("driving_type")
    private DrivingTypeEnum drivingType;

    /**
     * 首次执行时间
     */
    @TableField("first_run_time")
    private Date firstRunTime;

    /**
     * 时间间隔
     */
    @TableField("time_interval")
    private Integer timeInterval;

    /**
     * 时间单位；hour时，minute分，second秒，day日，month月
     */
    @TableField("time_unit")
    private String timeUnit;

    /**
     * 是否被引用；0不是，1是
     */
    @TableField("referenced")
    private Boolean referenced;

    /**
     * 是否有效；0无效，1有效
     */
    @TableLogic(value = "true",delval = "false")
    @TableField("is_valid")
    private Boolean isValid;
    @TableField("extend")
    private String extend;
    /**
     * 中断判断(秒)
     */
    @TableField("interrupt_judgment")
    private Integer interruptJudgment;

    public Integer getInterruptJudgment() {
        return interruptJudgment;
    }

    public void setInterruptJudgment(Integer interruptJudgment) {
        this.interruptJudgment = interruptJudgment;
    }

    public String getExtend() {
        return extend;
    }

    public void setExtend(String extend) {
        this.extend = extend;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCalLabel() {
        return calLabel;
    }

    public void setCalLabel(String calLabel) {
        this.calLabel = calLabel;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getModuleId() {
        return moduleId;
    }

    public void setModuleId(Long moduleId) {
        this.moduleId = moduleId;
    }

    public Integer getDecimalPlaces() {
        return decimalPlaces;
    }

    public void setDecimalPlaces(Integer decimalPlaces) {
        this.decimalPlaces = decimalPlaces;
    }

    public Boolean getDataSwitch() {
        return dataSwitch;
    }

    public void setDataSwitch(Boolean dataSwitch) {
        this.dataSwitch = dataSwitch;
    }

    public DrivingTypeEnum getDrivingType() {
        return drivingType;
    }

    public void setDrivingType(DrivingTypeEnum drivingType) {
        this.drivingType = drivingType;
    }

    public Date getFirstRunTime() {
        return firstRunTime;
    }

    public void setFirstRunTime(Date firstRunTime) {
        this.firstRunTime = firstRunTime;
    }

    public Integer getTimeInterval() {
        return timeInterval;
    }

    public void setTimeInterval(Integer timeInterval) {
        this.timeInterval = timeInterval;
    }

    public String getTimeUnit() {
        return timeUnit;
    }

    public void setTimeUnit(String timeUnit) {
        this.timeUnit = timeUnit;
    }

    public Boolean getReferenced() {
        return referenced;
    }

    public void setReferenced(Boolean referenced) {
        this.referenced = referenced;
    }

    public Boolean getIsValid() {
        return isValid;
    }

    public void setIsValid(Boolean isValid) {
        this.isValid = isValid;
    }
    @Override
    public String unique() {
        return calLabel;
    }
}
